
CREATE TABLE MOBILEPHONEPRODUCT
(
  MOBILEPHONEPRODUCTID  INTEGER                 NOT NULL,
  NAME                  NVARCHAR2(20)           NOT NULL,
  BRAND                 NVARCHAR2(10)           NOT NULL,
  NETWORKSYSTEM         NVARCHAR2(50)           NOT NULL,
  TIMETOMARKET          DATE,
  WEIGHT                INTEGER,
  LENGTH                INTEGER,
  WIDTH                 INTEGER,
  THICKNESS             INTEGER,
  OPTIONALSHELLCOLORS   NVARCHAR2(10),
  SCREENRESOLUTION      NVARCHAR2(20),
  SCREENMAXCOLORCOUNT   NVARCHAR2(20),
  SCREENSIZE            INTEGER,
  OPERATIONSYSTEM       NVARCHAR2(20),
  CPU                   NVARCHAR2(20),
  MEMORY                NVARCHAR2(20),
  INTERNALSTORAGE       NVARCHAR2(20),
  SUPPORTEDSTORAGECARD  NVARCHAR2(20),
  LASTMOIDIFIEDTIME     DATE,
  CREATEDTIME           DATE,
  ISDELETED             CHAR(1 BYTE),
  VERSION               INTEGER
)
TABLESPACE MPP_PROTOTYPE
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          64K
            MINEXTENTS       1
            MAXEXTENTS       2147483645
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE TABLE MOBILEPHONEACCESSORIES
(
  MOBILEPHONEPRODUCTID  INTEGER                 NOT NULL,
  BATTERYTYPE           NVARCHAR2(20),
  BATTERYCAPACITY       NVARCHAR2(20),
  BATTERYCOUNT          INTEGER,
  HASEARPHONE           CHAR(1 BYTE),
  HASCHARGER            CHAR(1 BYTE),
  HASDATALINE           CHAR(1 BYTE),
  OTHERS                NVARCHAR2(200)
)
TABLESPACE MPP_PROTOTYPE
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          64K
            MINEXTENTS       1
            MAXEXTENTS       2147483645
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE TABLE FUNCTIONITEMTYPE
(
  FUNCTIONITEMTYPEID  INTEGER                   NOT NULL,
  NAME                NVARCHAR2(20)             NOT NULL,
  LASTMODIFIEDTIME    DATE                      NOT NULL,
  ISDELETED           CHAR(1 BYTE),
  VERSION             INTEGER
)
TABLESPACE MPP_PROTOTYPE
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          64K
            MINEXTENTS       1
            MAXEXTENTS       2147483645
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


CREATE TABLE FUNCTIONITEM
(
  FUNCTIONITEMID        INTEGER                 NOT NULL,
  MOBILEPHONEPRODUCTID  INTEGER                 NOT NULL,
  FUNCTIONITEMTYPEID    INTEGER                 NOT NULL,
  DETAIL                NVARCHAR2(500),
  CREATEDTIME           DATE,
  LASTMODIFIEDTIME      DATE,
  ISDELETED             CHAR(1 BYTE),
  VERSION               INTEGER
)
TABLESPACE MPP_PROTOTYPE
PCTUSED    0
PCTFREE    10
INITRANS   1
MAXTRANS   255
STORAGE    (
            INITIAL          64K
            MINEXTENTS       1
            MAXEXTENTS       2147483645
            PCTINCREASE      0
            BUFFER_POOL      DEFAULT
           )
LOGGING 
NOCOMPRESS 
NOCACHE
NOPARALLEL
MONITORING;


ALTER TABLE MOBILEPHONEPRODUCT ADD (
  PRIMARY KEY
 (MOBILEPHONEPRODUCTID)
    USING INDEX 
    TABLESPACE MPP_PROTOTYPE
    PCTFREE    10
    INITRANS   2
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                MINEXTENTS       1
                MAXEXTENTS       2147483645
                PCTINCREASE      0
               ));


ALTER TABLE FUNCTIONITEMTYPE ADD (
  PRIMARY KEY
 (FUNCTIONITEMTYPEID)
    USING INDEX 
    TABLESPACE MPP_PROTOTYPE
    PCTFREE    10
    INITRANS   2
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                MINEXTENTS       1
                MAXEXTENTS       2147483645
                PCTINCREASE      0
               ));


ALTER TABLE FUNCTIONITEM ADD (
  PRIMARY KEY
 (FUNCTIONITEMID)
    USING INDEX 
    TABLESPACE MPP_PROTOTYPE
    PCTFREE    10
    INITRANS   2
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                MINEXTENTS       1
                MAXEXTENTS       2147483645
                PCTINCREASE      0
               ));


ALTER TABLE MOBILEPHONEACCESSORIES ADD (
  FOREIGN KEY (MOBILEPHONEPRODUCTID) 
 REFERENCES MOBILEPHONEPRODUCT (MOBILEPHONEPRODUCTID));


ALTER TABLE FUNCTIONITEM ADD (
  FOREIGN KEY (FUNCTIONITEMTYPEID) 
 REFERENCES FUNCTIONITEMTYPE (FUNCTIONITEMTYPEID));

ALTER TABLE FUNCTIONITEM ADD (
  FOREIGN KEY (MOBILEPHONEPRODUCTID) 
 REFERENCES MOBILEPHONEPRODUCT (MOBILEPHONEPRODUCTID));



Insert into FUNCTIONITEMTYPE
   (FUNCTIONITEMTYPEID, NAME, LASTMODIFIEDTIME, ISDELETED, VERSION)
 Values
   (0, 'Video Player', TO_DATE('10/02/2012 18:00:00', 'MM/DD/YYYY HH24:MI:SS'), '0', 0);
Insert into FUNCTIONITEMTYPE
   (FUNCTIONITEMTYPEID, NAME, LASTMODIFIEDTIME, ISDELETED, VERSION)
 Values
   (1, 'Music Player', TO_DATE('10/02/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '0', 0);
Insert into FUNCTIONITEMTYPE
   (FUNCTIONITEMTYPEID, NAME, LASTMODIFIEDTIME, ISDELETED, VERSION)
 Values
   (2, 'FM Radiogam', TO_DATE('10/02/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '0', 0);
Insert into FUNCTIONITEMTYPE
   (FUNCTIONITEMTYPEID, NAME, LASTMODIFIEDTIME, ISDELETED, VERSION)
 Values
   (3, 'FM Flash Player', TO_DATE('10/02/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '0', 0);
Insert into FUNCTIONITEMTYPE
   (FUNCTIONITEMTYPEID, NAME, LASTMODIFIEDTIME, ISDELETED, VERSION)
 Values
   (4, 'Web Browse', TO_DATE('10/02/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '0', 0);
Insert into FUNCTIONITEMTYPE
   (FUNCTIONITEMTYPEID, NAME, LASTMODIFIEDTIME, ISDELETED, VERSION)
 Values
   (5, 'Camera', TO_DATE('10/02/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '0', 0);
Insert into FUNCTIONITEMTYPE
   (FUNCTIONITEMTYPEID, NAME, LASTMODIFIEDTIME, ISDELETED, VERSION)
 Values
   (6, 'Photoflash', TO_DATE('10/02/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '0', 0);
Insert into FUNCTIONITEMTYPE
   (FUNCTIONITEMTYPEID, NAME, LASTMODIFIEDTIME, ISDELETED, VERSION)
 Values
   (7, 'PhoneResolution', TO_DATE('10/02/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '0', 0);
Insert into FUNCTIONITEMTYPE
   (FUNCTIONITEMTYPEID, NAME, LASTMODIFIEDTIME, ISDELETED, VERSION)
 Values
   (8, 'Bluetooth', TO_DATE('10/02/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '0', 0);
Insert into FUNCTIONITEMTYPE
   (FUNCTIONITEMTYPEID, NAME, LASTMODIFIEDTIME, ISDELETED, VERSION)
 Values
   (9, 'Data Interface', TO_DATE('10/02/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '0', 0);
Insert into FUNCTIONITEMTYPE
   (FUNCTIONITEMTYPEID, NAME, LASTMODIFIEDTIME, ISDELETED, VERSION)
 Values
   (10, 'Earphone Interface', TO_DATE('10/02/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '0', 0);
Insert into FUNCTIONITEMTYPE
   (FUNCTIONITEMTYPEID, NAME, LASTMODIFIEDTIME, ISDELETED, VERSION)
 Values
   (11, 'Soft Keyboard', TO_DATE('10/02/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '0', 0);
Insert into FUNCTIONITEMTYPE
   (FUNCTIONITEMTYPEID, NAME, LASTMODIFIEDTIME, ISDELETED, VERSION)
 Values
   (12, 'Gravity Sensor', TO_DATE('10/02/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '0', 0);
Insert into FUNCTIONITEMTYPE
   (FUNCTIONITEMTYPEID, NAME, LASTMODIFIEDTIME, ISDELETED, VERSION)
 Values
   (13, 'Acceleration Sensor', TO_DATE('10/02/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '0', 0);
Insert into FUNCTIONITEMTYPE
   (FUNCTIONITEMTYPEID, NAME, LASTMODIFIEDTIME, ISDELETED, VERSION)
 Values
   (14, 'Java Extension', TO_DATE('10/02/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '0', 0);
Insert into FUNCTIONITEMTYPE
   (FUNCTIONITEMTYPEID, NAME, LASTMODIFIEDTIME, ISDELETED, VERSION)
 Values
   (15, 'GPS', TO_DATE('10/02/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '0', 0);
Insert into FUNCTIONITEMTYPE
   (FUNCTIONITEMTYPEID, NAME, LASTMODIFIEDTIME, ISDELETED, VERSION)
 Values
   (16, 'E-Map', TO_DATE('10/02/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '0', 0);
COMMIT;




